---
apiVersion: v1
kind: ServiceAccount
metadata:
  name: d8-vertical-pod-autoscaler-recommender
  namespace: kube-system
  {{- include "helm_lib_module_labels" (list . (dict "app" "vpa-recommender")) | nindent 2 }}
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
  name: d8:vertical-pod-autoscaler:recommender:metrics-reader
  {{- include "helm_lib_module_labels" (list .) | nindent 2 }}
rules:
- apiGroups:
  - "metrics.k8s.io"
  resources:
  - pods
  verbs:
  - get
  - list
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
  name: d8:vertical-pod-autoscaler:recommender:metrics-reader
  {{- include "helm_lib_module_labels" (list .) | nindent 2 }}
roleRef:
  apiGroup: rbac.authorization.k8s.io
  kind: ClusterRole
  name: d8:vertical-pod-autoscaler:recommender:metrics-reader
subjects:
- kind: ServiceAccount
  name: d8-vertical-pod-autoscaler-recommender
  namespace: kube-system
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
  name: d8:vertical-pod-autoscaler:recommender:checkpoint-actor
  {{- include "helm_lib_module_labels" (list .) | nindent 2 }}
rules:
- apiGroups:
  - "poc.autoscaling.k8s.io"
  resources:
  - verticalpodautoscalercheckpoints
  verbs:
  - get
  - list
  - watch
  - create
  - patch
  - delete
- apiGroups:
  - "autoscaling.k8s.io"
  resources:
  - verticalpodautoscalercheckpoints
  verbs:
  - get
  - list
  - watch
  - create
  - patch
  - delete
- apiGroups:
  - ""
  resources:
  - namespaces
  verbs:
  - get
  - list
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
  name: d8:vertical-pod-autoscaler:recommender:checkpoint-actor
  {{- include "helm_lib_module_labels" (list .) | nindent 2 }}
roleRef:
  apiGroup: rbac.authorization.k8s.io
  kind: ClusterRole
  name: d8:vertical-pod-autoscaler:recommender:checkpoint-actor
subjects:
- kind: ServiceAccount
  name: d8-vertical-pod-autoscaler-recommender
  namespace: kube-system
